<?php
class FieldModel extends Model {
	public function createinput($id){
		$data = $this -> find();
		$fieldDB = M('Field');
		$field_list = $fieldDB -> where(array('form_id' => $data['id'])) -> select();
		//生成字段的表单元素
		foreach($field_list as $k => $v){
			$view -> assign('field_'.$v['id'], fieldDispose($v));
		}
		

		if(!$data){
			return '';
		}

		
		return '<form class="guestbookdataform" enctype="multipart/form-data" action="'.U('Home/Mission/insert').'" method="post"><input type="hidden" name="form_id" value="'.$data["id"].'">'.$view -> fetch('',$data['template']).'
		</form>';
	}
	
	
	
	

}